﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace MvcApplication5.Models
{
    public class News
    {
        [Required(ErrorMessage= "Bạn chưa nhập tiêu đề tin")]
        public int NewsId { get; set; }        
        
        public string Title { get; set; }        
        public string Image { get; set; }
        public string Content { get; set; }
        public string Summary { get; set; }
        public string Summary2 { get; set; }
        public int status { get; set; }
        public int level { get; set; }
        public int ViewCount { get; set; }
        public DateTime? SentDate { get; set; }
        public DateTime? PublishedDate { get; set; }
        public DateTime? LastModifiedDate { get; set; }
        public string LastModifiedBy { get; set; }
        public string PublishedBy { get; set; }
        public bool isHot { get; set; }
        public int position { get; set; }
        public int position2 { get; set; }
        public bool focus { get; set; }
        public int? CategoryId { get; set; }
        public int? AuthorId { get; set; }
        public int? AccountId { get; set; }
        public virtual Category Category { get; set; }
        public virtual Author Author { get; set; }
        public virtual ICollection<RelatedDetails> RelatedDetails { get; set; }
        public virtual ICollection<TagDetails> TagDetails { get; set; }
        public virtual ICollection<Comment> CommentList { get; set; }
    }

    public class Tag
    {
        public int TagId { get; set; }
        public string TagName { get; set; }
        public virtual ICollection<TagDetails> TagDetails { get; set; }
    }

    public class TagDetails
    {
        public int TagDetailsId { get; set; }
        public int TagId { get; set; }
        public virtual Tag Tag { get; set; }
        public int NewsId { get; set; }
        public virtual News News { get; set; }
    }

    public class Comment
    {
        public int CommentId { get; set; }
        public string Name { get; set; }
        public string Content { get; set; }
        public DateTime Date { get; set; }
        public int status { get; set; }
        public int NewsId { get; set; }
        public virtual News News { get; set; }
    }

    public class Author
    {
        public int AuthorId { get; set; }
        public string Name { get; set; }
        public virtual ICollection<News> NewsList { get; set; }
    }
}